package com.test.nnooolwdeaer.util_wooden;

import android.content.Context;
import android.content.pm.PackageManager;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;

import com.test.nnooolwdeaer.constant_wooden.Constant_wooden;

public class PermissionUtil_wooden {

    //检查权限是否全部获取
    public static boolean checkLaunchPermissions_wooden(@NonNull Context context, String... permissions) {
        try {
            for (String permission:permissions){
                if (PackageManager.PERMISSION_GRANTED != ContextCompat.checkSelfPermission(context, permission)) {
                    Log.d(PermissionUtil_wooden.class.getSimpleName(), "checkPermissions: "+permission);
                    return false;
                }
            }
        } catch (Exception e) {
            if (Constant_wooden.Debug) e.printStackTrace();
        }
        return true;
    }

}
